@model SectionGroup
@{
    Script.Reqiured("lightBox").AtFoot();
    Style.Reqiured("lightBox").AtFoot();
    var contents = Model.SectionContents.Where(m=>m.SectionContentType==(int)SectionContentBase.Types.Image).OrderBy(m=>m.Order).Cast<SectionContentImage>();
    int count = contents.Count() / 4;
    count += contents.Count() % 4 == 0 ? 0 : 1;
}

@for (int i = 0; i < count; i++)
{
    <div class="row">
        @foreach (var content in contents.Skip(i * 4).Take(4))
        {
            <div class="col-xs-12 col-sm-3">
                <a class="thumbnail" href="@Url.Content(content.ImageSrc)" data-lightbox="thumbnail" data-title="@content.ImageTitle">
                    <img src="@Url.Content(content.ImageSrc)" />
                </a>
            </div>
        }
    </div>
}
